﻿using MiniFox.Utility;
using System.Collections.ObjectModel;
using Wechat.MP;
using Wechat.MP.Models;

namespace Wechat.MP.Configurations
{
    /// <summary>
    /// 
    /// </summary>
    public class WechatClientSettingCollection : KeyedCollection<string, WechatClientSetting>
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="item"></param>
        /// <returns></returns>
        protected override string GetKeyForItem(WechatClientSetting item)
        {
            return item.Name;
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="settings"></param>
        public static implicit operator WechatClientCollection(WechatClientSettingCollection settings)
        {
            var collection = new WechatClientCollection();
            settings.ForEach(x => collection.Add(x));
            return collection;
        }
    }

}
